import {
	BIGGIFTANIM,
	LIVEGIFTLIST
} from '../actions/gift';

function gift(state = {
	giftAnim: [],
	liveGift: []
}, action) {
	switch (action.type) {
		case BIGGIFTANIM:
			let list = action.list;
			for(let i=0; i<list.length; i++){
				state.giftAnim[list[i].giftid] = list[i].url;
			}
			return state;
		case LIVEGIFTLIST:
			return Object.assign({},state, {
				liveGift: action.list,
			});
		default:
			return state
	}
}

export default gift;